Simplify mathematical expressions involving fractions